package com.spar.openprojects.shared.rowmapper;

import java.sql.ResultSet;
import java.sql.SQLException;

import com.spar.openprojects.shared.BusinessPartner;
import com.sql.database.IRowMapper;

public class BusinessPartnerRowMapper implements IRowMapper {

	@Override
	public BusinessPartner mapRow(ResultSet rs) throws SQLException {
		BusinessPartner businessPartner = new BusinessPartner();
		businessPartner.setId(rs.getInt("b.id"));
		businessPartner.setName(rs.getString("b.name"));
		businessPartner.setContact(rs.getString("b.contact"));
		businessPartner.setContactTitle(rs.getString("b.contact_title"));
		businessPartner.setEmail(rs.getString("b.email"));
		businessPartner.setStreet(rs.getString("b.street"));
		businessPartner.setPostalCode(rs.getString("b.postal_code"));
		businessPartner.setCity(rs.getString("b.city"));
		return businessPartner;
	}

}
